//package com.dkx.springbootwebsocket.config;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.ApplicationArguments;
//import org.springframework.boot.ApplicationRunner;
//import org.springframework.messaging.simp.user.SimpSession;
//import org.springframework.messaging.simp.user.SimpSubscription;
//import org.springframework.messaging.simp.user.SimpUser;
//import org.springframework.messaging.simp.user.SimpUserRegistry;
//
//import org.springframework.stereotype.Component;
//
//import java.util.Collection;
//
///**
// * @Author: 杜科璇
// * @Description:
// * @Date: 2025/10/31 22:21
// * @Version: 1.0
// */
//@Component
//@Slf4j
//public class WebSocketConfigChecker implements ApplicationRunner {
//
//    @Autowired
//    private SimpUserRegistry simpUserRegistry;
//
//    @Override
//    public void run(ApplicationArguments args) throws Exception {
//        log.info("=== WebSocket配置检查 ===");
//        log.info("SimpUserRegistry 类型: {}", simpUserRegistry.getClass().getName());
//
//        // 检查初始用户
//        Collection<SimpUser> users = simpUserRegistry.getUsers();
//        log.info("初始连接用户数: {}", users.size());
//
//        for (SimpUser user : users) {
//            log.info("用户: {}, 会话数: {}", user.getName(), user.getSessions().size());
//            for (SimpSession session : user.getSessions()) {
//                log.info("  会话ID: {}", session.getId());
//                for (SimpSubscription subscription : session.getSubscriptions()) {
//                    log.info("    订阅: {}", subscription.getDestination());
//                }
//            }
//        }
//        log.info("=== WebSocket配置检查结束 ===");
//    }
//}